import  request  from '@/util/request.js'
import api from '@/api'

export const reqLogin = (data) => {
  return request.post(api.login , data)
}

// 用户详情
export const reqUserInfoByOwner = () => {
  return request.get(api.userInfoByOwner)
}

// 登出
export const reqLogout = (data) => {
  return request.get('/user/logout' , data)
}


// 获取验证码
export const getCode = (data) => {
  return request.get(api.getCode , {
    params: data
  })
}


// 查询用户
export const searchUser = (searchKey) => {
  return request.get(api.userSearch + searchKey)
}

// 好友申请
export const applyContact = (data) => {
  return request.post(api.applyContact, data)
}


// 查询用户的所有好友列表
export const getUserApplyList = (searchKey) => {
  return request.get(api.applyList + searchKey)
}

// 通过好友
export const handleContactApply = (data) => {
  return request.post(api.handleContactApply  , data)
}
